#/bin/bash

export PKG_CONFIG_ALLOW_CROSS=1
export MINGW_PREFIX=/usr/x86_64-w64-mingw32
export PKG_CONFIG_PATH=$MINGW_PREFIX/lib/pkgconfig
cargo build --target=x86_64-pc-windows-gnu --release

PACKAGE_PATH=/tmp/tsp-viewer
mkdir $PACKAGE_PATH
cp target/x86_64-pc-windows-gnu/release/*.exe $PACKAGE_PATH
cp $MINGW_PREFIX/bin/*.dll $PACKAGE_PATH
mkdir -p $PACKAGE_PATH/share/glib-2.0/schemas
cp $MINGW_PREFIX/share/glib-2.0/schemas/gschemas.compiled $PACKAGE_PATH/share/glib-2.0/schemas/gschemas.compiled
cp -r $MINGW_PREFIX/share/icons $PACKAGE_PATH/share/icons
